﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tdv.Wfrp.CharacterGenerator.Client.ViewModels.Interfaces;
using Tdv.Wfrp.CharacterGenerator.Domain.Characteristics;
using System.Windows.Data;

namespace Tdv.Wfrp.CharacterGenerator.Client.ViewModels.Implementations
{
    public class CharacteristicViewModel : ViewModelBase, ICharacteristicViewModel
    {

        private ICharacteristicRepository _CharacteristicRepository;
        

        public CharacteristicViewModel(ICharacteristicRepository characteristicRepository)
        {
            _CharacteristicRepository = characteristicRepository;

            _CharacteristisCollectionViewSource = new CollectionViewSource() { Source = _CharacteristicRepository.GetAll() };

        }

        private CollectionViewSource _CharacteristisCollectionViewSource;

        public CollectionViewSource CharacteristicCollectionViewSource
        {
            get { return _CharacteristisCollectionViewSource; }
            set
            {
                if (value != _CharacteristisCollectionViewSource)
                {
                    _CharacteristisCollectionViewSource = value;
                    OnPropertyChanged("CharacteristicCollectionViewSource");
                }
            }
        }
    }
}
